<template>
  <div class="app-container">
    <div class="backoff">
      <div>
         <el-button class="anniu">工程结束</el-button>
        <el-button class="anniu" @click="$router.go(-1)">返回</el-button>
      </div>
    </div>
    <el-tabs class="tac" tab-position="left">
      <el-tab-pane style="height: 100%" label="详情">
        <div
          style="width: 100%; height: 100%; overflow: auto; margin-top: 60px"
        >
          <el-form
            :model="form"
            label-width="170px"
            :disabled="true"
            class="fromsBox"
          >
            <el-form-item label="项目编号 :">
              <el-input
                v-model="form.biddingNumber"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item label="包号 :">
              <el-input
                v-model="form.biddingProjectNumber"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item label="项目名称 :">
              <el-input
                v-model="form.biddingProjectName"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item label="采购方式 :">
              <el-input
                v-model="form.biddingType"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item label="预算金额 :">
              <el-input
                v-model="form.marginAmount"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item label="采购需求 :">
              <el-input
                type="textarea"
                autosize
                v-model="form.content"
              ></el-input>
            </el-form-item>
            <el-form-item label="申请人资格需求 :">
              <el-input type="textarea" autosize v-model="form.zige"></el-input>
            </el-form-item>
            <el-form-item label="开标时间 :">
              <el-input
                v-model="form.bidBeginTime"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item label="开标地点 :">
              <el-input v-model="form.didian" autocomplete="off"></el-input>
            </el-form-item>
          </el-form>
        </div>
      </el-tab-pane>
            <el-tab-pane style="height: 100%" label="出函机构">
        <div
          style="width: 100%; height: 100%; overflow: auto; margin-top: 60px"
        >
          <el-form
            :model="form"
            label-width="170px"
            :disabled="true"
            class="fromsBox"
          >
            <el-form-item label="公司名称 :">
              <el-input
                v-model="form.bidding_number"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item label="法人姓名 :">
              <el-input
                v-model="form.bidding_project_number"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item label="法人联系方式 :">
              <el-input
                v-model="form.bidding_project_name"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item label="统一社会信用代码 :">
              <el-input
                v-model="form.bidding_type"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item label="公司类型 :">
              <el-input
                v-model="form.margin_amount"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item label="公司地址 :">
              <el-input
                type="textarea"
                autosize
                v-model="form.content"
              ></el-input>
            </el-form-item>
            <el-form-item label="开户行 :">
              <el-input  autosize v-model="form.zige"></el-input>
            </el-form-item>
            <el-form-item label="账户 :">
              <el-input
                v-model="form.bid_begin_time"
                autocomplete="off"
              ></el-input>
            </el-form-item>
            <el-form-item label="联行号 :">
              <el-input v-model="form.didian" autocomplete="off"></el-input>
            </el-form-item>
             <el-form-item label="费率 :">
              <el-input v-model="form.didian" autocomplete="off"></el-input>
            </el-form-item>
             <el-form-item label="营业执照 :">
              <el-image :url="form.didian" style="height: 100px" autocomplete="off"></el-image>
            </el-form-item>
          </el-form>
        </div>
      </el-tab-pane>
      <el-tab-pane style="height: 100%" label="工程进度">
        <div
          style="width: 100%; height: 100%; overflow: auto; margin-top: 60px"
        >
          <div class="fromsBox1">
            <div
              v-if="form.jindu == null || form.jindu == '' || form.jindu == []"
              class="zanwu"
            >
              暂无数据
            </div>

            <el-row class="mb8">
              <el-col :span="18">
                
                <el-button
                  type="info"
                  @click="shuaxin"
                  icon="el-icon-refresh-right"
                ></el-button>
                <el-button style="background:#409eff" type="info" @click="detaiopen">添加进度</el-button>
              </el-col>
              <el-col :span="6" class="seach">
                <el-input v-model="input" placeholder="请输入关键字"></el-input>
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  @click="seach1"
                ></el-button>
              </el-col>
            </el-row>
            <el-table :data="form.jindu" class="table" height="100%">
              <el-table-column
                align="center"
                prop="bidding_number"
                label="工程编号"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                align="center"
                prop="bidding_name"
                label="工程名称"
                show-overflow-tooltip
              />
              <el-table-column
                align="center"
                prop="username"
                label="上传人"
              ></el-table-column>
              <el-table-column
                align="center"
                prop="createtime"
                label="上传时间"
              ></el-table-column>
              <el-table-column
                align="center"
                prop="checkname"
                label="审批人"
              ></el-table-column>
              <el-table-column
                align="center"
                prop="checktime"
                label="审批时间"
              ></el-table-column>
              <el-table-column
                align="center"
                prop="remark"
                label="备注"
              ></el-table-column>
              <el-table-column align="center" label="操作" width="120">
                <template slot-scope="scope">
                  <el-button size="mini" @click="detailViews(scope.row)"
                    >查看详情</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
            <div class="block">
              <el-pagination
                background
                @size-change="handleSizeChange1"
                @current-change="handleCurrentChange1"
                :page-sizes="[5, 10, 20, 30]"
                :page-size="params1.limit"
                :current-page="params1.offset"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total1"
              ></el-pagination>
            </div>
          </div>
        </div>
      </el-tab-pane>
            <el-tab-pane style="height: 100%" label="保函文件">
        <div
          style="width: 100%; height: 100%; overflow: auto; margin-top: 60px"
        >
          <div class="fromsBox1">
            <div
              v-if="form.jindu == null || form.jindu == '' || form.jindu == []"
              class="zanwu"
            >
              暂无数据
            </div>

            <el-row class="mb8">
              <el-col :span="18">
                
                <el-button
                  type="info"
                  @click="shuaxin"
                  icon="el-icon-refresh-right"
                ></el-button>
                <!-- <el-button style="background:#409eff" type="info" @click="detaiopen">添加进度</el-button> -->
              </el-col>
              <el-col :span="6" class="seach">
                <el-input v-model="input" placeholder="请输入关键字"></el-input>
                <el-button
                  type="primary"
                  icon="el-icon-search"
                  @click="seach1"
                ></el-button>
              </el-col>
            </el-row>
            <el-table :data="form.jindu" class="table" height="100%">
              <el-table-column
                align="center"
                prop="bidding_number"
                label="保函编号"
                show-overflow-tooltip
              >
              </el-table-column>
              <el-table-column
                align="center"
                prop="bidding_name"
                label="保函名称"
                show-overflow-tooltip
              />
              <el-table-column
                align="center"
                prop="username"
                label="保证金额"
              ></el-table-column>
                   <el-table-column
                align="center"
                prop="checkname"
                label="保费"
              ></el-table-column>
              <el-table-column
                align="center"
                prop="createtime"
                label="起始时间"
              ></el-table-column>
         
              <el-table-column
                align="center"
                prop="checktime"
                label="生效时间"
              ></el-table-column>
              <!-- <el-table-column
                align="center"
                prop="remark"
                label="备注"
              ></el-table-column> -->
              <el-table-column align="center" label="操作" width="120">
                <template slot-scope="scope">
                  <el-button size="mini" @click="detailViews(scope.row)"
                    >查看保函</el-button
                  >
                </template>
              </el-table-column>
            </el-table>
            <div class="block">
              <el-pagination
                background
                @size-change="handleSizeChange1"
                @current-change="handleCurrentChange1"
                :page-sizes="[5, 10, 20, 30]"
                :page-size="params1.limit"
                :current-page="params1.offset"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total1"
              ></el-pagination>
            </div>
          </div>
        </div>
      </el-tab-pane>
      <!-- <el-tab-pane style="height: 100%;" label="采购需求">
                <el-form :model="form" :disabled="true" class="fromsBox">
                    <el-form-item>
                        {{ form.xuqiu }}
                    </el-form-item>

                </el-form>
            </el-tab-pane> -->
      <!-- <el-tab-pane style="height: 100%;" label="申请人资格需求">
                <el-form :model="form" :disabled="true" class="fromsBox">
                    <el-input type="textarea" v-model="form.zige"></el-input>
                </el-form>
            </el-tab-pane> -->
      <!-- <el-tab-pane style="height: 100%;" label="时间地点">
                <el-form :model="form" label-width="170px" :disabled="true" class="fromsBox">
                    <el-form-item label="开标时间 :">
                        <el-input v-model="form.didian.bid_begin_time" autocomplete="off"></el-input>
                    </el-form-item>
                    <el-form-item label="开标地点 :">
                        <el-input v-model="form.didian.didian" autocomplete="off"></el-input>
                    </el-form-item>
                </el-form>
            </el-tab-pane> -->
    </el-tabs>
    <el-dialog
      title="上传进度资料"
      :visible.sync="open"
      width="50%"
      :close-on-click-modal="false"
      v-dialogDrag
      custom-class="publicDialog"
    >
      <el-form ref="form" :model="forms" label-width="120px" class="">
        <el-form-item label="申请编号 :">
          <el-input v-model="forms.apply_number" disabled="true"></el-input>
        </el-form-item>
        <el-form-item label="备注 :">
          <el-input type="textarea" v-model="forms.remark"></el-input>
        </el-form-item>
        <el-form-item label="上传图片 :">
          <el-row :gutter="110">
            <el-col :span="24">
              <div
                class="avatar"
                v-show="forms.pro_image.length > 0"
                v-for="(item, index) in forms.pro_image"
                :key="index"
              >
                <img :src="item" />
                <i
                  class="el-icon-delete"
                  @click="zhengdeleteImg(index)"
                  style="z-index: 10"
                ></i>
              </div>
              <el-upload
                class="avatar-uploader"
                action="http://192.168.0.28:8082/handle/baohan/uploads"
                :show-file-list="false"
                :on-success="zhengSuccess"
              >
                <div class="avatar-uploader-icon">
                  <i class="el-icon-plus"></i>
                </div>
              </el-upload>
            </el-col>
          </el-row>
        </el-form-item>
        <el-form-item label="上传视频 :">
          <el-upload
            class="upload-demo"
            ref="upload"
            action="http://192.168.0.28:8082/handle/baohan/uploads"
            :on-preview="handlePreview"
            :on-remove="handleRemove"
            :file-list="fileList"
            :on-success="handleSuccess"
          >
            <el-button slot="trigger" size="small" type="primary"
              >选取文件</el-button
            >
          </el-upload>
        </el-form-item>
      </el-form>
      <div class="footer">
        <el-button type="" class="btn" @click="save">提交</el-button>
        <el-button type="" class="btn" @click="open = false">取消</el-button>
      </div>
    </el-dialog>
    <el-dialog
      title="进度详情"
      :visible.sync="openJinDu"
      width="50%"
      :close-on-click-modal="false"
      v-dialogDrag
      custom-class="publicDialog"
    >
    <!-- {{ form.remark}} -->
     <div style="padding: 0 5%;display: flex;    align-items: center;"><div style="    width: 63px;">备注：</div>   <el-input v-model="remark" disabled autocomplete="off"></el-input></div>
      <div class="wenjianBox">
        <p class="tupian">图片 :</p>
        <div class="tpBox">
          <img :src="itm" alt="" v-for="(itm, idx) in pro_image" :key="idx" />
          <!-- <img src="https://img0.baidu.com/it/u=925843206,3288141497&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=769"
                        alt="" /> -->
        </div>
        <p class="tupian">视频 :</p>
        <ul class="videoList">
          <li v-for="(it, ix) in pro_video" :key="ix">
            <div @click="see(it)">
              <i class="el-icon-video-play"></i>
            </div>
          </li>
        </ul>
      </div>
    </el-dialog>

    <el-dialog
      title="视频"
      :visible.sync="dialogVideo"
      width="50%"
      :close-on-click-modal="false"
      v-dialogDrag
      custom-class="publicDialog"
    >
      <div class="wenjianBox">
        <iframe
          width="100%"
          height="400px"
          :src="videoUrl"
          allowfullscreen
        ></iframe>
      </div>
    </el-dialog>
  </div>
</template>
    
<script>
import { gcdetail } from "@/api/daihou.js";

export default {
  data() {
    return {
      formLabelAlign: {}, //申请公司信息
      chjg: {}, //出汗机构
      shenqingInfo: {}, //申请信息
      baohanFile: "", //保函文件
      shenpiFile: "", //审批文件
      payList: "", //支付记录
      kdList: "", //快递记录
      jinduInfo: {}, //进度信息
      remark:"",
    //   form: {
    //     jindu: [],
    //   },
    forms:{
apply_number:"",
remark:"",
pro_image: [],
pro_video:[],
    },
         form : {
          // bid_begin_time: "2022-11-30 09:00:00",
          // bid_end_time: "2022-11-30 09:00:00",
          // bidding_code: "415999907",
          // bidding_number: "豫财招标采购-2022-1270",
          // bidding_project_name:
          //   "河南省民政学校幼儿保育专业产教融合实训基地建设项目",
          // bidding_project_number: "豫政采(2)20221986-1",
          // bidding_type: "公开招标",
          // content:
          //   "5.1 本项目采购内容：河南省民政学校幼儿保育专业产教融合实训基地建设，具体采购需求详见附件。<br/>5.2 资金来源：财政资金。<br/>5.3 交货期：合同生效之日起，45 日历天内供货、安装、调试完毕。<br/>5.4 质保期： 3 年。<br/>5.5 交货地点：采购人指定地点。<br/>6、合同履行期限：同交货及安装调试期。",
          // create_time: "2022-11-15 14:27:20",
          // html_base64_str: null,
          // margin_amount: "1190000",
          // moneysource: 0,
          // moneysource_txt: "政府资金",
          // other: null,
          // proid: 68,
          // purchase_person_name: "河南省民政学校",
          // source: "系统",
          // status: 0,
          // jindu: [
          //   {
          //     bidding_id: 20221119114357000,
          //     bidding_name:
          //       "河南省民政学校幼儿保育专业产教融合实训基地建设项目",
          //     bidding_number: "豫财招标采购-2022-1270",
          //     check_id: null,
          //     checkname: null,
          //     checktime: "2022-11-21 14:41:10",
          //     createtime: "2022-11-21 14:41:10",
          //     guarantee_apply_id: 1292,
          //     id: 4,
          //     pro_image: [
          //       "http://192.168.0.28:8082/uploads/20221121/e4e17b49a0109ae03052da57aee71d90.jpg",
          //     ],
          //     pro_video: [
          //       "http://192.168.0.28:8082/uploads/20221121/fc3d68838995e2bf1e27cee57a55e978.mp4",
          //     ],
          //   },
          // ],
        },
      params1: {
        limit: 10,
        offset: 1,
      },
      openJinDu: false,
          open: false,
      dialogVideo: false,
      pro_image: [],
      pro_video: [],
      videoUrl: "",
    };
  },
  created() {
    console.log("Jeis", this.$route.query);
    this.getDetail(this.$route.query.id);
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event);
    },
    shuaxin(){
 this.getDetail(this.$route.query.id);
    },
    // 获取详情
    getDetail(id) {
      gcdetail(id).then((res) => {
        console.log(res.data);
        this.form = res.data.data
      });
    },
      save() {
      this.forms.pro_image = this.forms.pro_image.join(",");
      this.forms.pro_video = this.forms.pro_video.join(",");
      addpro({ ...this.forms }).then((res) => {
        if (res.data.code == 1) {
          this.open = false;
          (this.form = {
            apply_number: "",
            pro_image: [],
            pro_video: [],
            remark: "",
          }),
            this.$message({
              message: res.data.msg,
              type: "success",
            });
        } else {
          this.$message({
            message: res.data.msg,
            type: "warning",
          });
        }
      });
    },
    detailViews(val) {
      this.pro_image = "";
      this.pro_video = "";
      this.openJinDu = true;
      this.remark=""
      this.pro_image = val.pro_image;
      this.pro_video = val.pro_video;
        this.remark=val.remark
    },
    see(url) {
      this.dialogVideo = true;
      this.videoUrl = url;
    },
    detaiopen(){
      this.open=true
    }
  },
};
</script>
<style scoped lang="scss">
.weidaili_head {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.search {
  float: right;
  width: 20%;
  height: 40px;
  border: 1px solid #ccc;
  border-radius: 5px;
  display: flex;

  ::v-deep.el-input__inner {
    border: none !important;
  }

  .el-button {
    border: none;
  }
}

::v-deep.el-input__inner {
  border: none !important;
}

.weidaili {
  height: 75vh;
  margin-bottom: 10px;
  overflow: hidden;
}

.block {
  width: 100%;
  padding-right: 20px;
  display: flex;
  justify-content: flex-end;
}

.showphoto {
  height: 553px;
  background: #f5f6fa;
  border-radius: 4px 4px 4px 4px;
  opacity: 1;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
}

.showphoto1 {
  height: 553px;
  background: #f5f6fa;
  border-radius: 4px 4px 4px 4px;
  opacity: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.el-tabs .el-tab-pane {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  // overflow-y: auto;
}

.app-container {
  height: 90%;
  padding-bottom: 0px;
  position: relative;
  // background-color: #fff;
  // display: flex;
  // flex-direction: column;
  // position: relative;
}

// ::v-deep .el-tabs__content {
//   // height: 100% !important;
// }

.fromsBox {
  width: 70%;
  margin: 0px auto;
  // margin-top: 60px;

  .el-form-item {
    margin-bottom: 4px;
    margin-left: 20px;
  }
}

.fromsBox1 {
  width: 100%;
  height: 84%;
  margin: 0px auto;
  // margin-top: 60px;

  .el-form-item {
    margin-bottom: 4px;
    margin-left: 20px;
  }
}

.title {
  font-weight: bold;
  margin-bottom: 10px;
}

.left {
  width: 70%;
  margin: 0px auto;
  margin-top: 60px;
}

.conter {
  margin-left: 20px;
  // width: 85%;
}

.backoff {
  position: absolute;
  z-index: 999;
  left: 222px;
  top: 0px;
  // margin-left: 180px;
  display: flex;
  justify-content: flex-end;
  padding: 5px 0;
  box-sizing: border-box;
  border-bottom: 2px solid #d9dbde;

  div {
    width: calc(100vw - 240px);
    display: flex;
    justify-content: flex-end;
    padding-right: 20px;
  }

  .el-button {
    border: 1px solid;
  }
}

.rzBox {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%);

  .el-button {
    width: 150px !important;
  }
}

.renzhng {
  flex: 1;
  overflow-y: auto;
  padding: 0 10%;

  .el-form-item {
    margin-bottom: 4px;
  }
}

.footer {
  display: flex;
  padding-left: 10px;
  box-sizing: border-box;
  height: 45px;
  // justify-content: center;
  align-items: center;
  background-color: #f4f4f5 !important;

  .btn {
    width: 80px;
    height: 35px;
    border: 1px solid #1795ff;
  }
}

.table {
  margin-top: 50px;
}

.tac {
  height: 100%;
}

::v-deep .tac .el-tabs__content {
  height: 100%;
  overflow-y: auto;
}

::v-deep .el-tabs__header {
  width: 200px !important;
}

::v-deep .el-tabs__item {
  font-size: 18px;
  height: 50px;
  line-height: 50px;
}

::v-deep .el-tabs--left .el-tabs__item.is-active {
  background: #1795ff;
  color: #fff;
}

.conBox {
  width: 100%;

  .conBox-top {
    p {
      display: flex;
      align-items: center;
      margin-bottom: 10px;

      span {
        display: inline-block;
        width: 80px;
      }
    }
  }

  .tupian {
    width: 80px;
  }
}

.tpBox {
  margin-left: 45px;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;

  img {
    width: 23%;
    height: 180px;
    margin-left: 10px;
    margin-bottom: 10px;
  }
}

.videoList {
  display: flex;
  // justify-content: space-around;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
  margin: 0;
  margin-left: 45px;

  li {
    width: 23%;
    margin-bottom: 10px;
    margin-left: 10px;

    div {
      width: 100%;
      height: 180px;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: #333;
      margin-bottom: 10px;
      font-size: 30px;
      color: #fff;
    }
  }
}

.zanwu {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%);
  font-size: 18px;
  color: #999;
}

.wenjianBox {
  flex: 1;
  overflow-y: auto;
  padding: 0 5%;
  // display: flex;
  font-size: 16px;
  // flex-wrap: wrap;
}
</style>
    